<title>站点设置</title>
  
<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a><cite>问答管理</cite></a>
    <a><cite>基本设置</cite></a>
    <a><cite>站点设置</cite></a>
  </div>
</div>


  <div class="layui-fluid">
        <div class="layui-card">
          <div class="layui-card-header">站点设置</div>
          <div class="layui-card-body">
            
          <form class="layui-form layui-form-module" action="{:url('wendasns/config/post')}" method="post">
          <input type="hidden" name="type" value="website"/>
          
            <div class="layui-form-item">
              <label class="layui-form-label">站点名称</label>
              <div class="layui-input-inline">
                <input type="text" name="webName" value="{$data.webName}" class="layui-input">
              </div>
              <div class="layui-form-mid layui-word-aux">默认站点名称</div>
            </div>

          <div class="layui-form-item">
            <label class="layui-form-label">站点LOGO</label>
            <div class="layui-input-inline">
                <div style="margin-bottom: 10px;"><img id="webLogo" src="/static/wendasns/images/logo.png?v={:time()}" width="135" height="44"/></div>
                <button type="button" class="layui-btn layui-btn-primary" id="logoUpload">
                  <i class="layui-icon">&#xe67c;</i>上传LOGO
                </button>
            </div>
            <div class="layui-form-mid layui-word-aux">建议logo尺寸135px*37px，支持jpg、gif、png</div>
          </div>
          
            <div class="layui-form-item">
              <label class="layui-form-label">ICP 备案信息</label>
              <div class="layui-input-inline">
                <input type="text" name="icpInfo" value="{$data.icpInfo}" class="layui-input">
              </div>
              <div class="layui-form-mid layui-word-aux">填写 ICP 备案的信息，例如: 桂ICP备xxxxxxxx号</div>
            </div>
            
            <div class="layui-form-item layui-form-text">
              <label class="layui-form-label">第三方统计代码</label>
              <div class="layui-input-inline">
                <textarea name="statisCode" class="layui-textarea">{$data.statisCode}</textarea>
              </div>
              <div class="layui-form-mid layui-word-aux">在第三方网站上注册并获得统计代码，并将统计代码粘帖在下面文本框中即可。</div>
            </div>
            
            <div class="layui-form-item">
              <label class="layui-form-label">关闭站点</label>
              <div class="layui-input-inline">
                <input type="radio" name="webClose" value="1" title="是" {if $data.webClose eq 1}checked="checked"{/if}>
                <input type="radio" name="webClose" value="0" title="否" {if $data.webClose eq 0}checked="checked"{/if}>
              </div>
              <div class="layui-form-mid layui-word-aux">除管理员，其他用户不允许访问站点，一般用于站点关闭、系统维护等情况</div>
            </div>

            <div class="layui-form-item layui-form-text">
              <label class="layui-form-label">限制访问提示</label>
              <div class="layui-input-inline">
                <textarea name="visitMessage" class="layui-textarea">{$data.visitMessage}</textarea>
              </div>
              <div class="layui-form-mid layui-word-aux">当站点处于内部开放状态时，网站显示的提示信息</div>
            </div>
            
            <div class="layui-form-item">
              <div class="layui-input-block">
                  <button class="layui-btn" lay-submit lay-filter="J_ajax_submit_btn"><i class="layui-icon layui-icon-ok-circle"></i>提交</button>
              </div>
            </div>
            
          </form>
            
          </div>
    </div>
  </div>
<script>
;!function(){
  var $ = layui.$
  ,form = layui.form
  ,upload = layui.upload;
  
  form.render();

    //普通图片上传
    var uploadInst = upload.render({
      elem: '#logoUpload'
      ,url: '{:url('wendasns/config/upload')}'
      ,before: function(obj){
        //预读本地文件示例，不支持ie8
        obj.preview(function(index, file, result){
          $('#webLogo').attr('src', result); //图片链接（base64）
        });
      }
      ,done: function(res){
        layer.msg(res.msg);
      }
      ,error: function(){
        layer.msg('上传失败');
      }
    });
    
}();
</script>